#include "BinObserver.hpp"
#include "ObservedObject.cpp"
#include <iostream>
#include <stdlib.h>

using namespace std;

BinObserver::BinObserver(ObservedObject<int> *observedObject) : Observer<int>(observedObject) {}

void BinObserver::notify()
{
    char bin_string[100] = {0};
    itoa(observedObject->getValue(), bin_string, 2);
    cout << "2进制：0b" << bin_string << endl;
}